package com.mallcloud.mall.product.api.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mallcloud.mall.common.core.model.BaseModel;
import com.mallcloud.mall.common.core.util.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

@ApiModel(value = "CategoryModel", description = "分类信息")
@Data
@TableName(value = "P_CATEGORY", autoResultMap = true)
public class CategoryModel extends BaseModel {
    private static final long serialVersionUID = 1L;

    @NotNull(groups = ValidGroup.Update.class, message = "店铺不能为空")
    @TableId(type = IdType.AUTO)
    @ApiModelProperty(value = "分类id")
    private Long categoryId;

    @NotNull(groups = ValidGroup.Insert.class, message = "店铺不能为空")
    @ApiModelProperty(value = "店铺id")
    private Long shopId;

    @ApiModelProperty(value = "父ID")
    private Long parentId;

    @ApiModelProperty(value = "分类名称")
    private String name;

    @ApiModelProperty(value = "分类描述")
    private String description;

    @ApiModelProperty(value = "分类地址{parent_id}-{child_id},...")
    private String path;

    @ApiModelProperty(value = "状态 1:enable, 0:disable")
    private Integer status;

    @ApiModelProperty(value = "分类图标")
    private String icon;

    @ApiModelProperty(value = "分类的显示图片")
    private String imgUrl;

    @ApiModelProperty(value = "分类层级 从0开始")
    private Integer categoryLevel;

    @ApiModelProperty(value = "排序")
    private Integer sortOrder;
}
